#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# -*- mode: python -*-

from __future__ import print_function
from __future__ import absolute_import
from __future__ import division

def main():
    import collections
    result = []
    queue = collections.deque()
    queue.append(BaseException)
    while queue:
        cls = queue.popleft()
        for subcls in cls.__subclasses__():
            if subcls.__module__ != Exception.__module__:
                continue
            result.append((subcls, cls))
            queue.append(subcls)
    for subcls, cls in result:
        print('%s: %s' % (subcls.__name__, cls.__name__))

if __name__ == '__main__':
    main()
